<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.petcommunity.model.User" %>
<%
    response.setCharacterEncoding("UTF-8");
%>
<%
    User user = (User) session.getAttribute("user");
    if (user == null) {
        response.sendRedirect("login.jsp");
        return;
    }
%>
<html>
<head>
    <title>宠物管理系统 - 控制台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background: url('imgs/2.png') no-repeat center center fixed;
            background-size: cover;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            position: relative;
        }

        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.2);
            z-index: 1;
        }

        .dashboard-container {
            width: 100%;
            max-width: 1200px;
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            animation: fadeInUp 0.8s ease-out;
            position: relative;
            z-index: 2;
            min-height: 700px;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .header {
            background: linear-gradient(135deg, #FFE4E1 0%, #FFF8DC 100%);
            padding: 40px 50px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255, 182, 193, 0.3) 0%, transparent 70%);
            animation: float 6s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0px) rotate(0deg); }
            50% { transform: translateY(-20px) rotate(180deg); }
        }

        .welcome-title {
            font-size: 2.5rem;
            color: #FF6B6B;
            font-weight: bold;
            margin-bottom: 10px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
            z-index: 2;
            position: relative;
        }

        .welcome-subtitle {
            font-size: 1.2rem;
            color: #8B4513;
            z-index: 2;
            position: relative;
        }

        .main-content {
            padding: 50px;
            background: white;
        }

        .menu-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 25px;
            margin-bottom: 40px;
        }

        .menu-item {
            background: white;
            border: 2px solid #E8E8E8;
            border-radius: 15px;
            padding: 30px 25px;
            text-align: center;
            transition: all 0.3s ease;
            text-decoration: none;
            color: #333;
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        .menu-item::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #FFE4E1 0%, #FFF8DC 100%);
            transition: left 0.3s ease;
            z-index: 1;
        }

        .menu-item:hover::before {
            left: 0;
        }

        .menu-item:hover {
            border-color: #FF6B6B;
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
        }

        .menu-item-content {
            position: relative;
            z-index: 2;
        }

        .menu-icon {
            font-size: 3rem;
            margin-bottom: 15px;
            color: #FF6B6B;
            transition: all 0.3s ease;
        }

        .menu-item:hover .menu-icon {
            transform: scale(1.1);
            color: #FF5252;
        }

        .menu-title {
            font-size: 1.3rem;
            font-weight: 600;
            margin-bottom: 8px;
            color: #333;
        }

        .menu-description {
            font-size: 0.9rem;
            color: #666;
            line-height: 1.4;
        }

        .logout-container {
            text-align: center;
            padding-top: 20px;
            border-top: 2px solid #F0F0F0;
        }

        .logout-btn {
            display: inline-block;
            padding: 15px 40px;
            background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
            color: white;
            text-decoration: none;
            border-radius: 25px;
            font-size: 1.1rem;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
        }

        .logout-btn:hover {
            background: linear-gradient(135deg, #FF5252 0%, #FF7575 100%);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
        }

        .decorative-paws {
            position: absolute;
            font-size: 1.5rem;
            color: rgba(255, 107, 107, 0.2);
            animation: rotate 8s linear infinite;
        }

        .paw-1 {
            top: 20px;
            right: 30px;
            animation-delay: 0s;
        }

        .paw-2 {
            bottom: 30px;
            right: 20px;
            animation-delay: 2s;
        }

        .paw-3 {
            top: 50%;
            right: 10px;
            animation-delay: 4s;
        }

        .paw-4 {
            top: 30%;
            left: 20px;
            animation-delay: 6s;
        }

        @keyframes rotate {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .dashboard-container {
                margin: 10px;
                border-radius: 15px;
            }

            .header {
                padding: 30px 20px;
            }

            .welcome-title {
                font-size: 2rem;
            }

            .welcome-subtitle {
                font-size: 1rem;
            }

            .main-content {
                padding: 30px 20px;
            }

            .menu-grid {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            .menu-item {
                padding: 25px 20px;
            }

            .menu-icon {
                font-size: 2.5rem;
            }

            .menu-title {
                font-size: 1.1rem;
            }
        }
    </style>
</head>
<body>
    <div class="dashboard-container">
        <!-- 装饰性爪印 -->
        <div class="decorative-paws paw-1">🐾</div>
        <div class="decorative-paws paw-2">🐾</div>
        <div class="decorative-paws paw-3">🐾</div>
        <div class="decorative-paws paw-4">🐾</div>

        <!-- 头部欢迎区域 -->
        <div class="header">
            <h1 class="welcome-title">欢迎您，<%= user.getUsername() %>!</h1>
            <p class="welcome-subtitle">社区宠物管理系统控制台</p>
        </div>

        <!-- 主要内容区域 -->
        <div class="main-content">
            <div class="menu-grid">
                <a href="owners" class="menu-item">
                    <div class="menu-item-content">
                        <div class="menu-icon">👥</div>
                        <h3 class="menu-title">宠物主人管理</h3>
                        <p class="menu-description">用心维系每一份信任</p>
                    </div>
                </a>

                <a href="pets" class="menu-item">
                    <div class="menu-item-content">
                        <div class="menu-icon">🐕</div>
                        <h3 class="menu-title">宠物管理</h3>
                        <p class="menu-description">给毛孩子一个专属成长档案</p>
                    </div>
                </a>

                <a href="vaccines" class="menu-item">
                    <div class="menu-item-content">
                        <div class="menu-icon">💉</div>
                        <h3 class="menu-title">疫苗记录</h3>
                        <p class="menu-description">为宠物健康筑起坚实防线</p>
                    </div>
                </a>

                <a href="lostpets" class="menu-item">
                    <div class="menu-item-content">
                        <div class="menu-icon">🔍</div>
                        <h3 class="menu-title">走失宠物</h3>
                        <p class="menu-description">帮助每个小生命找到回家的路</p>
                    </div>
                </a>

                <a href="adoptions" class="menu-item">
                    <div class="menu-item-content">
                        <div class="menu-icon">❤️</div>
                        <h3 class="menu-title">领养管理</h3>
                        <p class="menu-description">为每个小生命找到温暖的家</p>
                    </div>
                </a>

                <a href="notices" class="menu-item">
                    <div class="menu-item-content">
                        <div class="menu-icon">📢</div>
                        <h3 class="menu-title">通知管理</h3>
                        <p class="menu-description">让重要消息及时抵达每个角落</p>
                    </div>
                </a>
            </div>

            <div class="logout-container">
                <a href="login.jsp" class="logout-btn">退出登录</a>
            </div>
        </div>
    </div>
</body>
</html>